package com.barneyx.mshinfoplatform.entity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Value;

@Getter
public enum ETemplateType implements IEnum<String> {
    INFO(101, "INFO"), //信息类
    NEWS(102, "NEWS"), //信息类
    ARTICLE(103, "ARTICLE"),//信息、文章类
    ARTICLE_DETAIL(104, "ARTICLE_DETAIL"),//直接文章打开
    ;

    @EnumValue
    private final int code;
    @JsonProperty
    private final String value;

    ETemplateType(int code, String value) {
        this.code = code;
        this.value = value;
    }


    public static ETemplateType StrTo(String value) {
        for (ETemplateType e : ETemplateType.values()) {
            if (e.getValue().equals(value)) return e;
        }
        return null;
    }
}
